define(["jQuery", "kendo"], function ($, kendo) {
    return {
    	// creationMode:false,
		// isGrid: 0,
		// heightGrid : 0,
		// widthGrid : 0,
		// isDashed : 0,
		show : function(){ 
		
			
			$( "#lock-dragable-menu" ).show();	 
		},
		
        init: function (e) {
			$("#lock-dragable-menu").draggable({cancel:"#text-box-password-lock"});
			$("#lock-dragable-menu").hide(); 
			$('#text-box-password-lock').click(function () {    
				$(this).focus();
			});
			$(".ok-lock-button").click(function() {
				$( "#lock-dragable-menu" ).hide(); 
				App.withoutPass = 0;
				if($('#text-box-password-lock').val() == ""){
					alert(App.localize("%no_password_warning"));
				}else{
					App.socket.emit('cm_lock', {
										roomid: App.fileId,
										pageid:App.pageId, 
										objectId: App.idIndicatorLast, 
										id: App.userId,
										status:App.statusLock, 
										userName: App.username, 
										password:$('#text-box-password-lock').val(), 
										without_pass:App.withoutPass
								});
				}
				
			});
			
			$(".cancel-lock-button").click(function() {
				var r=confirm(App.localize("%cancel_confirmation"));
				if (r==true)
				{
					$( "#lock-dragable-menu" ).hide(); 
				}
				else
				{
					console.log("You pressed Cancel!");
				}
			});	
			
			$(".without-lock-button").click(function() { 
				App.withoutPass = 1;
				$( "#lock-dragable-menu" ).hide(); 

				App.socket.emit('cm_lock', {
										roomid: App.fileId,
										pageid:App.pageId, 
										objectId: App.idIndicatorLast, 
										id: App.userId,
										status:App.statusLock, 
										userName: App.username, 
										password:"", 
										without_pass:App.withoutPass
								});
			});	

			 
		
		}
	}
});